using System;
using System.Configuration;

namespace Typed.Configuration.ConfigSource
{
    public class AppSettingsSource : IStringConfigSource
    {
        public AppSettingsSource()
        {
        }

        #region IStringConfigSource Members

        public bool TryGetString(string fieldName, out string value)
        {
            value = null;
            string str = ConfigurationManager.AppSettings.Get(fieldName);
            if (str == null)
                return false;
            value = str;
            return true;
        }

        #endregion
    }
}